package com.yikome.report.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yikome.report.request.OrderReportRequest;
import com.yikome.report.response.OrderReportResponse;
import com.yikome.report.service.OrderReportService;
import com.itmuch.lightsecurity.annotation.PreAuthorize;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/admin/order/report")
public class OrderReportController {

	@Autowired
	private OrderReportService orderReportService ; 
	
	@GetMapping("/sale")
	@PreAuthorize("hasAnyRoles('admin', 'analysis', 'finance')")
	public List<OrderReportResponse> findOrderReports(OrderReportRequest orderReportRequest){
		return orderReportService.findOrderReports(orderReportRequest);
	}
}
